<?php
namespace core\database\driver;

use core\database\IDatabase;

class MySQL implements IDatabase
{
	/**
	 * @var false|resource
	 */
	private $link;

	function connect($host, $user, $pass, $dbname)
	{
		$db = mysql_connect($host, $user, $pass);
		mysql_select_db($dbname, $db);
		$this->link = $db;
	}

	function query($sql)
	{
		return mysql_query($sql, $this->link);
	}

	function close()
	{
		mysql_close($this->link);
	}
}